import { defHttp } from "@/utils/http";
// ERP 产品分类 VO
export interface drugCategoryVO {
	id: number; // 分类编号
	parentId: number; // 父分类编号
	name: string; // 分类名称
	code: string; // 分类编码
	sort: number; // 分类排序
	status: number; // 开启状态
}

// ERP 产品分类 API
export const drugCategoryApi = {
	// 查询产品分类列表
	getdrugCategoryList: async (params: any) => {
		return await defHttp.get({ url: `/whs/drug-type/list`, params });
	},

	// 查询产品分类精简列表
	getdrugCategorySimpleList: async () => {
		return await defHttp.get({ url: `/whs/drug-type/simple-list` });
	},

	// 查询产品分类详情
	getdrugCategory: async (id: number) => {
		return await defHttp.get({ url: `/whs/drug-type/get?id=` + id });
	},

	// 新增产品分类
	createdrugCategory: async (data: drugCategoryVO) => {
		return await defHttp.post({ url: `/whs/drug-type/create`, data });
	},

	// 修改产品分类
	updatedrugCategory: async (data: drugCategoryVO) => {
		return await defHttp.put({ url: `/whs/drug-type/update`, data });
	},

	// 删除产品分类
	deletedrugCategory: async (id: number) => {
		return await defHttp.delete({ url: `/whs/drug-type/delete?id=` + id });
	},

	// 导出产品分类 Excel
	exportdrugCategory: async (params: any) => {
		return await defHttp.download({ url: `/whs/drug-type/export-excel`, params });
	}
};
